package cc11001100.snakeyaml;

import org.yaml.snakeyaml.Yaml;

import java.io.IOException;
import java.io.InputStream;

/**
 * @author CC11001100
 */
public class PocMain {

    public static void main(String[] args) throws IOException {

        String filepath = "clusterfuzz-testcase-minimized-YamlFuzzer-5427149240139776";
        Yaml yaml = new Yaml();
        InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(filepath);
        Object o = yaml.load(inputStream);

        // Output:
        // Exception in thread "main" java.lang.StackOverflowError
        //	at org.yaml.snakeyaml.reader.StreamReader.peek(StreamReader.java:136)
        //	at org.yaml.snakeyaml.scanner.ScannerImpl.scanToNextToken(ScannerImpl.java:1230)
        //	at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:329)
        //	at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:251)
        //	at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockSequenceEntryValue.produce(ParserImpl.java:562)
        //	at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockSequenceEntryKey.produce(ParserImpl.java:538)
        //	at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockSequenceFirstEntry.produce(ParserImpl.java:526)
        //	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:166)
        //	at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:156)
        //	at org.yaml.snakeyaml.composer.Composer.composeSequenceNode(Composer.java:240)
        //	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:186)
        //	at org.yaml.snakeyaml.composer.Composer.composeSequenceNode(Composer.java:245)
        //	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:186)
        //	at org.yaml.snakeyaml.composer.Composer.composeSequenceNode(Composer.java:245)
        //	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:186)
        // ......

    }

}
